using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Searcher
{
    internal partial class frmPreferences : Form
    {
        public frmPreferences()
        {
            InitializeComponent();
        }


        public Int32 MaxDocLines
        {
            get { return (rbAllDoc.Checked ? 0 : (Int32)nudMaxDocLines.Value); }
            set
            {
                if (value == 0)
                {
                    nudMaxDocLines.Enabled = false;
                    lbPageCount.Enabled = false;
                    rbAllDoc.Checked = true;
                }
                else
                {
                    rbPageDocView.Checked = true;
                    nudMaxDocLines.Value = value;
                }
            }
        }


        public Int32 MaxSearchLines
        {
            get { return ((Int32)nudMaxSearchLines.Value); }
            set { nudMaxSearchLines.Value = value; }
        }


        private void btCancel_Click(object sender, EventArgs e)
        {

        }

        private void btOK_Click(object sender, EventArgs e)
        {

        }

        private void rbAllDoc_Click(object sender, EventArgs e)
        {
            lbPageCount.Enabled = false;
            nudMaxDocLines.Enabled = false;
        }

        private void rbPageDocView_Click(object sender, EventArgs e)
        {
            nudMaxDocLines.Enabled = true;
            lbPageCount.Enabled = true;
        }
    }
}